import request from '@/utils/request'

// 获取问卷调查列表
export const postUsser = (data) => {
  return request.post('/admin/investigate/list', {
    page: data.page,
    limit: data.limit,
    keyword: data.keyword
  }
  )
}

// 问卷调查新增
export const postUser = (data) => {
  return request.post('/admin/investigate/save', {
    title: data.title,
    desc: data.desc,
    banner: data.banner,
    status: data.status,
    start_time: data.start_time,
    end_time: data.end_time,
    prize_status: data.prize_status,
    everybody_count: data.everybody_count,
    prize_desc: data.prize_desc,
    answer_limit: data.answer_limit,
    max_answer_count: data.max_answer_count,
    range: data.range
  }
  )
}
// 修改问卷调查
export const updataUser = (data) => {
  return request.post('/admin/investigate/save', {
    id: data.id,
    title: data.title,
    desc: data.desc,
    banner: data.banner,
    status: data.status,
    start_time: data.start_time,
    end_time: data.end_time,
    prize_status: data.prize_status,
    everybody_count: data.everybody_count,
    prize_desc: data.prize_desc,
    answer_limit: data.answer_limit,
    max_answer_count: data.max_answer_count,
    range: data.range

  }
  )
}

// 获取奖品列表

export const postprize = (data) => {
  return request.post('/admin/prize/list', {
    investigate_id: data.investigate_id,
    keyword: data.keyword
  }
  )
}
// 中奖记录列表

export const postRecording = (data) => {
  return request.post('/admin/investigate/people/prize/list', {
    investigate_id: data.investigate_id,
    page: data.page,
    limit: data.limit,
    keyword: data.keyword
  }
  )
}

// 问题问卷列表

export const postIssue = (data) => {
  return request.post('/admin/question/list', {
    investigate_id: data.investigate_id,
    keyword: data.keyword
  }
  )
}

// 问题答卷列表

export const postAnswer = (data) => {
  return request.post('/admin/investigate/people/answer/list', {
    investigate_id: data.investigate_id,
    people_id: data.people_id
  }
  )
}

// 参与人数列表

export const postparticipate = (data) => {
  return request.post('/admin/investigate/people/list', {
    investigate_id: data.investigate_id,
    page: data.page,
    limit: data.limit,
    keyword: data.keyword
  }
  )
}

// 新增奖品

export const postprizeNew = (data) => {
  return request.post('/admin/prize/save', {
    investigate_id: data.investigate_id,
    title: data.title,
    status: data.status,
    count: data.count,
    image: data.image,
    odds: data.odds
  }
  )
}

// 添加问题

export const postiIssue = (data) => {
  return request.post('/admin/question/save', {
    investigate_id: data.investigate_id,
    title: data.title,
    type: data.type,
    options: data.options,
    status: data.status,
    open_other: data.open_other
  }
  )
}

// 修改奖品

export const postrevise = (data) => {
  return request.post('/admin/prize/save', {
    id: data.id,
    investigate_id: data.investigate_id,
    title: data.title,
    status: data.status,
    count: data.count,
    image: data.image,
    odds: data.odds
  }
  )
}
// 修改问题
export const postissue = (data) => {
  return request.post('/admin/question/save', {
    investigate_id: data.investigate_id,
    id: data.id,
    title: data.title,
    type: data.type,
    options: data.options,
    status: data.status,
    open_other: data.open_other
  }
  )
}

// 报名限制列表获取
export const obtain = (data) => {
  return request.post('/admin/investigate/range/mobile/list', {
    investigate_id: data.investigate_id,
    page: data.page,
    limit: data.limit,
    keyword: data.keyword
  }
  )
}

// 报名限制新增
export const application = (data) => {
  return request.post('/admin/investigate/range/mobile/add', {
    investigate_id: data.investigate_id,
    mobile: data.mobile,
    name: data.name
  }
  )
}

// 报名限制修改
export const modify = (data) => {
  return request.post('/admin/investigate/range/mobile/add', {
    investigate_id: data.investigate_id,
    id: data.id,
    mobile: data.mobile,
    name: data.name
  }
  )
}

// 报名人数删除
export const dele = (data) => {
  return request.post('/admin/investigate/range/mobile/delete', {
    investigate_id: data.investigate_id,
    range_id: data.range_id
  }
  )
}
